﻿///  Copyright (c) 2010 Ray Liang (http://www.dotnetage.com)
///  Dual licensed under the MIT and GPL licenses:
///  http://www.opensource.org/licenses/mit-license.php
///  http://www.gnu.org/licenses/gpl.html

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;
using System.ComponentModel;
using System.Web.UI.WebControls;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Web.Script;


namespace DNA.UI.JQuery
{
    [JQuery(Name = "button", Assembly = "jQuery", DisposeMethod = "destroy",
   ScriptResources = new string[] { "ui.core.js", "ui.widget.js", "ui.button.js" }, StartEvent = ClientRegisterEvents.DocumentReady)]
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    [ToolboxData("<{0}:ToggleButton runat=\"server\" ID=\"ToggleButton1\"></{0}:ToggleButton>")]
    public class ToggleButton:CheckBox
    {
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            ClientScriptManager.RegisterJQueryControl(this);
        }
    }
}
